package com.yy.device.config;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 线程池服务配置
 *
 * @author sunzhiqiang
 * @date 2022/06/16 15:36:29
 */
public class ExecutorServiceConfig {

    public static final ExecutorService executorService = new ThreadPoolExecutor(12, 12,
            0L, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<>(50),
            new ThreadFactoryBuilder().setNameFormat("device-pool-%d").build(),
            new ThreadPoolExecutor.AbortPolicy());
}
